{include file="header.html"}
<script type="text/javascript">
    $(function(){
        $('#article_form').validate({
            errorPlacement: function(error, element){
                $(element).next('.field_notice').hide();
                $(element).after(error);
            },
            success       : function(label){
                label.addClass('right').text('OK!');
            },
            rules : {
                title : {
                    required : true
                },
                cate_id :{
                    required : true
                },
                link    :{
                    url     : true
                },
                sort_order:{
                    number   : true
                }
            },
            messages : {
                title : {
                    required : '{$lang.title_empty}'
                },
                cate_id : {
                    required : '{$lang.cate_empty}'
                },
                link    : {
                    url     : '{$lang.link_limit}'
                },
                sort_order  : {
                    number   : '{$lang.number_only}'
                }
            }
        });
    });

    function add_uploadedfile(file_data)
    {
        var newImg = '<tr id="' + file_data.file_id + '" class="tatr2"><input type="hidden" name="file_id[]" value="' + file_data.file_id + '" /><td><img width="40px" height="40px" src="' + SITE_URL + '/' + file_data.file_path + '" /></td><td>' + file_data.file_name + '</td><td><a href="javascript:insert_editor(\'' + file_data.file_name + '\', \'' + file_data.file_path + '\');">{$lang.insert_editor}</a> | <a href="javascript:drop_uploadedfile(' + file_data.file_id + ');">{$lang.drop}</a></td></tr>';
        $('#thumbnails').prepend(newImg);
    }
    function insert_editor(file_name, file_path){
        ue.execCommand( 'inserthtml', '<img src="'+ SITE_URL +'/' + file_path + '" alt="'+ file_name + '">');
    }
    function drop_uploadedfile(file_id)
    {
        if(!window.confirm(lang.uploadedfile_drop_confirm)){
            return;
        }
        $.getJSON('index.php?app=article&act=drop_uploadedfile&file_id=' + file_id, function(result){
            if(result.done){
                $('#' + file_id).remove();
            }else{
                alert('drop_error');
            }
        });
    }
</script>
{$build_editor1}
{$build_upload1}
{$build_editor2}
{$build_upload2}
<div id="rightTop">
    <p>内容</p>
    <ul class="subnav">
        <li>
            <!--{if $type == 'promotion_agreement'}-->
            <span>个人推广协议</span>
            <!--{else}-->
            <a class="btn1" href="index.php?app=textarea&act=extension&type=promotion_agreement">个人推广协议</a>

            <!--{/if}-->
        </li>
        <li>
            <!--{if $type == 'presentation_widthdraw'}-->
            <span>提现说明</span>
            <!--{else}-->
            <a class="btn1" href="index.php?app=textarea&act=extension&type=presentation_widthdraw">提现说明</a>

            <!--{/if}-->
        </li>
        <li>
            <!--{if $type == 'earn_cash'}-->
            <span>邀请好友赚现金规则说明</span>
            <!--{else}-->
            <a class="btn1" href="index.php?app=textarea&act=extension&type=earn_cash">邀请好友赚现金规则说明</a>

            <!--{/if}-->
        </li>
        <li>
            <!--{if $type == 'binding_ali_instructions'}-->
            <span>绑定支付宝说明</span>
            <!--{else}-->
            <a class="btn1" href="index.php?app=textarea&act=extension&type=binding_ali_instructions">绑定支付宝说明</a>

            <!--{/if}-->
        </li>
    </ul>
</div>

<div class="info">
    <form method="post" enctype="multipart/form-data" id="user_form">
        <table class="infoTable">

            <input type="hidden" name="type" value="{$type}">
            <tr>
                <th class="paddingT15">
                    <label for="resign">
                        <!--{if $type == 'resign'}-->
                        <span>用户使用协议(注册页面)</span>
                        <!--{elseif $type == 'wish'}-->
                        <span>心愿单说明(暂无)</span>
                        <!--{elseif $type == 'member'}-->
                        <span>个人资料身份说明(暂无)</span>
                        <!--{elseif $type == 'address'}-->
                        <span>用户购买须知(下单准备支付页面)</span>
                        <!--{elseif $type == 'our'}-->
                        <span>关于我们(我的-设置-关于我们)</span>
                        <!--{elseif $type == 'customs'}-->
                        <span>用户购买须知及海关协议(暂无)</span>
                        <!--{elseif $type == 'price'}-->
                        <span>价格说明(暂无)</span>
                        <!--{elseif $type == 'know'}-->
                        <span>购物须知(商品详情)</span>
                        <!--{elseif $type == 'rull'}-->
                        <span>帮我买规则(心愿单详情)</span>
                        <!--{elseif $type == 'personal'}-->
                        <span>隐私政策(注册页面)</span>
                        <!--{/if}-->
                    </label>
                </th>
                <td class="paddingT15 wordSpacing5">
                    <textarea id="resign" name="resign" style="width:650px;height:400px;">{$textarea|escape}</textarea>
                </td>
            </tr>

            <tr>
                <th></th>
                <td class="ptb20"><input class="formbtn" type="submit" name="Submit" value="{$lang.submit}" />
                    <input class="formbtn" type="reset" name="Submit2" value="{$lang.reset}" />
                </td>
            </tr>
        </table>
    </form>
</div>
{include file="footer.html"}